import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { UserModule } from './user/user.module';
import { AuthModule } from './auth/auth.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { PublicModule } from './public/public.module';
import { SliderCodeModule } from './slider-code/slider-code.module';
import { CodeModule } from './code/code.module';
import { UserService } from './user/user.service';
import { RoleGuardService } from './auth/role-guard.service';
import { AuthGuardService } from './auth/auth-guard.service';
import { HttpStrategyService } from './auth/http-strategy.service';

@Module({
  imports: [
    UserModule,
    AuthModule,
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: '182.254.243.206',
      port: 3306,
      username: 'faya',
      password: 'faya',
      database: 'faya',
      entities: [__dirname + '/**/*.entity{.ts,.js}'],
      synchronize: true,
    }),
    PublicModule,
    SliderCodeModule,
    CodeModule,
  ],
  controllers: [AppController],
  providers: [
    AppService,
    UserService,
    RoleGuardService,
    AuthGuardService,
    HttpStrategyService,
  ],
})
export class AppModule {}
